/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.File;
import java.io.IOException;

/**
 * <p>Project: app2022 - Exec1
 * <p>Powered by webrx On 2022-01-17 14:41:13
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Exec1 {
    public static void main(String[] args) {
        Runtime run = Runtime.getRuntime();
        try {
            //windows 系统下的cmd命令
            //run.exec("cmd /k start http://www.baidu.com");
            //run.exec("cmd /k start D:\\soft\\es\\EditPlus.exe");
            //删除目录（空目录，非空目录都可以删除）
            //run.exec("cmd /k rd /S /Q c:\\abc");
            //run.exec("cmd /k rd /S /Q c:\\u1");

            //建立目录对象
            File f = new File("c:/abc");
            //获取对象的绝对路径，会自动按系统来返回字符串
            //windows c:\\abc linux /abc
            System.out.println(f.getAbsolutePath());
            run.exec("cmd /k rd /S /Q " + f.getAbsolutePath());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
